package com.loeng.module.infra.controller.admin.logger.vo.apierrorlog;

import com.loeng.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;

import static com.loeng.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;

/**
 * API 错误日志分页 Request VO
 * @author loeng zhuo
 */
@Schema(description = "管理后台 - 系统异常日志分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ApiErrorLogPageReqVO extends PageParam {

    @Schema(description = "链路追踪编号", example = "7007")
    private String traceId;

    @Schema(description = "用户编号", example = "14175")
    private Long userId;

    @Schema(description = "用户类型", example = "2")
    private Integer userType;

    @Schema(description = "应用名", example = "李四")
    private String applicationName;

    @Schema(description = "请求方法名")
    private String requestMethod;

    @Schema(description = "请求地址", example = "https://www.iocoder.cn")
    private String requestUrl;

    @Schema(description = "请求参数")
    private String requestParams;

    @Schema(description = "用户 IP")
    private String userIp;

    @Schema(description = "浏览器 UA")
    private String userAgent;

    @Schema(description = "异常发生时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime[] exceptionTime;

    @Schema(description = "异常名", example = "赵六")
    private String exceptionName;

    @Schema(description = "异常导致的消息")
    private String exceptionMessage;

    @Schema(description = "异常导致的根消息")
    private String exceptionRootCauseMessage;

    @Schema(description = "异常的栈轨迹")
    private String exceptionStackTrace;

    @Schema(description = "异常发生的类全名", example = "张三")
    private String exceptionClassName;

    @Schema(description = "异常发生的类文件", example = "王五")
    private String exceptionFileName;

    @Schema(description = "异常发生的方法名", example = "王五")
    private String exceptionMethodName;

    @Schema(description = "异常发生的方法所在行")
    private Integer exceptionLineNumber;

    @Schema(description = "处理状态", example = "1")
    private Integer processStatus;

    @Schema(description = "处理时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime[] processTime;

    @Schema(description = "处理用户编号", example = "8808")
    private Integer processUserId;

    @Schema(description = "创建时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime[] createTime;

}